package com.maven.blog.model;

import com.maven.blog.utils.DateFormat;
import lombok.Data;

import java.util.Date;

@Data
public class Blog {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;



    private Integer deleteFlag;
    private Date createTime;
    private Date updateTime;

    private Boolean isLoginUser;

    // 这里将数据修改成我们需要的格式
    public String getCreateTime() {
        return DateFormat.formatDate(createTime);
    }

    public String getUpdateTime() {
        return DateFormat.formatDate(updateTime);
    }

    public Blog() {
    }

    public Blog(String title, String content, Integer userId) {
        this.title = title;
        this.content = content;
        this.userId = userId;
    }
}
